Skip to content

Remove reflection in AutoConfigurationChecker #getConfigurations#49058

Closed
GaetanoCerciello wants to merge 1 commit intospring-projects:mainfrom
GaetanoCerciello:remove-reflection-auto-configuration
Closed

Remove reflection in AutoConfigurationChecker #getConfigurations#49058
GaetanoCerciello wants to merge 1 commit intospring-projects:mainfrom
GaetanoCerciello:remove-reflection-auto-configuration

Conversation

@GaetanoCerciello
Copy link

Description

This pull request removes the use of reflection in AutoConfigurationChecker#getConfigurations() and replaces it with a direct approach using ArchUnit's public API.

Problem

The AutoConfigurations#getConfigurations() method was using reflection to access a private JavaClasses.of() factory method:

Method method = ReflectionUtils.findMethod(JavaClasses.class, "of", Iterable.class);
ReflectionUtils.makeAccessible(method);
return (JavaClasses) ReflectionUtils.invokeMethod(method, null, this.classes.values());

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 4, 2026
@philwebb philwebb requested a review from mhalbritter February 4, 2026 19:11
@mhalbritter mhalbritter self-assigned this Feb 5, 2026
@mhalbritter
Copy link
Contributor

Yes, this change makes sense and works, thanks! Please sign off your commit.

@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Feb 5, 2026
@GaetanoCerciello GaetanoCerciello force-pushed the remove-reflection-auto-configuration branch from 25c383b to 16dd10a Compare February 5, 2026 09:03
Signed-off-by: producer <producer@MacBookPro.home>
Signed-off-by: Gaetano Cerciello <cerciello980@gmail.com>
@GaetanoCerciello GaetanoCerciello force-pushed the remove-reflection-auto-configuration branch from 16dd10a to 7fc299e Compare February 5, 2026 09:16
@GaetanoCerciello
Copy link
Author

@mhalbritter
Thank you for the review! I've added the sign-off to the commit as requested.

Changes made:

  • ✅ Added Signed-off-by to the commit message
  • ✅ Force-pushed the updated commit to the branch

The commit now includes the required sign-off and is ready for merge.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Feb 5, 2026
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Feb 5, 2026
@philwebb philwebb added this to the 3.5.x milestone Feb 5, 2026
@mhalbritter mhalbritter modified the milestones: 3.5.x, 4.0.x Feb 6, 2026
mhalbritter pushed a commit that referenced this pull request Feb 6, 2026
See gh-49058

Signed-off-by: Gaetano Cerciello <cerciello980@gmail.com>
@mhalbritter
Copy link
Contributor

Thanks @GaetanoCerciello !

@mhalbritter mhalbritter modified the milestones: 4.0.x, 4.0.3 Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants